import { EChartsOption } from 'echarts'

export const option: EChartsOption = {
  tooltip: {
    trigger: 'item',
    formatter: (params: any) => {
      return (
        params.marker +
        ' ' +
        params.name +
        '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>' +
        params.value +
        '</b> (' +
        params.percent +
        '%)'
      )
    }
  },
  legend: {},
  series: {
    name: '',
    type: 'pie',
    radius: ['35%', '75%'],
    center: ['50%', '55%'],
    // 不显示默认标签
    label: {
      show: false,
      position: 'center'
    },
    // 关闭防止标签重叠，圆环图中文字全部在中间显示
    avoidLabelOverlap: false,
    emphasis: {
      label: {
        show: true,
        fontSize: '19',
        color: '#606266',
        fontWeight: 'bold'
      },
      // 圆环的阴影
      itemStyle: {
        shadowBlur: 10,
        shadowOffsetX: 0,
        shadowColor: 'rgba(0, 0, 0, 0.5)'
      }
    },
    data: []
    // itemStyle: {
    //   color: (params) => {
    //     //自定义颜色
    //     const colorList = ['#0099cc', '#ff9933', '#009933', '#cc3300', '#666699', '#ff6666']
    //     return colorList[params.dataIndex]
    //   }
    // }
  }
}
